package mysql

import (
	"github.com/pkg/errors"
	my "gorm.io/driver/mysql"
	"gorm.io/gorm"
)

func Connect() (db *gorm.DB, err error) {
	dsn := "root:123456@tcp(127.0.0.1:3306)/task?charset=utf8mb4&parseTime=True&loc=Local"
	db, err = gorm.Open(my.Open(dsn), &gorm.Config{})
	if err != nil {
		return nil, errors.Wrap(err, "mysql Connect failed")
	}
	return
}
